package rdd01.text

import org.apache.spark.rdd.RDD
import org.apache.spark.{Partitioner, SparkConf, SparkContext}

object RDD_Text_Save {
  //存储RDD文件
  def main(args: Array[String]): Unit = {
    val sparkconf=new SparkConf().setMaster("local[*]").setAppName("persis")
    val sc=new SparkContext(sparkconf)
    val rdd=sc.makeRDD(List(
      ("nba","xsssssssss"),
      ("cba","xsssssssss"),
      ("wnba","xsssssssss"),
      ("nba","xsssssssss"),
      ("nba","xsssssssss")
    ),3)
    rdd.saveAsTextFile("out1")
    rdd.saveAsObjectFile("out2")
    rdd.saveAsSequenceFile("out3")
    sc.stop()

  }

}
